import request from '@/config/axios'

export interface DeviceRepairsVO {
  id: number
  deviceCode: string
  deviceName: string
  dictDeviceType: number
  questionDescribe: string
  fileId: number
  fileName: string
  explain: string
  dictRepairsStatus: number
}

// 查询生产管理-设备管理-设备报修列表
export const getDeviceRepairsPage = async (params) => {
  return await request.get({ url: `/produce/device-repairs/page`, params })
}

// 查询生产管理-设备管理-设备报修详情
export const getDeviceRepairs = async (id: number) => {
  return await request.get({ url: `/produce/device-repairs/get?id=` + id })
}

// 新增生产管理-设备管理-设备报修
export const createDeviceRepairs = async (data: DeviceRepairsVO) => {
  return await request.post({ url: `/produce/device-repairs/create`, data })
}

// 修改生产管理-设备管理-设备报修
export const updateDeviceRepairs = async (data: DeviceRepairsVO) => {
  return await request.put({ url: `/produce/device-repairs/update`, data })
}

// 删除生产管理-设备管理-设备报修
export const deleteDeviceRepairs = async (id: number) => {
  return await request.delete({ url: `/produce/device-repairs/delete?id=` + id })
}

// 导出生产管理-设备管理-设备报修 Excel
export const exportDeviceRepairs = async (data) => {
  return await request.download({ url: `/produce/device-repairs/export-excel`, data })
}

//获取设备名称、编码
export const getDeviceMessageList = async (params) => {
  return await request.post({ url: `/config/device-archives/list-all-simple`, params})
}